package com.app.service;

import java.util.List;
import javax.annotation.Resource;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import com.app.entity.Question;
import com.app.mapper.QuestionDAO;

@Service
public class QuestionServiceImpl implements QuestionService {
    @Resource
    QuestionDAO questionDao;

    public List<Question> getQuestionPager(@Param("skip") int skip, @Param("size") int size) {
        return questionDao.getQuestionPager(skip, size);
    }

    public Question getQuestionById(int id) {
        return questionDao.getQuestionById(id);
    }

    public int getQuestionCount() {
        return questionDao.getQuestionCount();
    }

    public int insert(Question entity) {
        return questionDao.insert(entity);
    }

    public int delete(int id) {
        return questionDao.delete(id);
    }

    public int update(Question entity) {
        return questionDao.update(entity);
    }

    public List<Question> getAllQuestion() {
        return questionDao.getAllQuestion();
    }

    public List<Question> getRandQuestion() {
        // TODO Auto-generated method stub
        return questionDao.getRandQuestion();
    }

	@Override
	public List<Question> getQuestionByType(String question_category) {
		// TODO Auto-generated method stub
		return questionDao.getQuestionByType(question_category);
	}

}
